<?php

/**
 * # com_jvframwork - JV Framework
 * # @version		1.5.x
 * # ------------------------------------------------------------------------
 * # author    Open Source Code Solutions Co
 * # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 * # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 * # Websites: http://www.joomlavi.com
 * # Technical Support:  http://www.joomlavi.com/my-tickets.html
 * -------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');

class JHTMLJVLib {

    /**
     * JHTMLJVLib::loadJSlib()
     * 
     * @param mixed $url
     * @return void
     */
    function loadJSlib($url, $extension = array(), $externalJS = array()) {
        $document =& JFactory::getDocument();
        
        $mooVersion = (float) JFactory::getApplication()->get('MooToolsVersion');        
        if( $mooVersion == 1.2){
            $document->addScript($url.'JVAdapter.1.2.5.js');     
        }else{
            $document->addScript($url.'JVAdapter.1.1.2.js');  
        }
        $document->addScript($url.'JVLib.js');
        
        foreach($extension as $ext){
             $document->addScript($url.$ext.'.js');
        }

        foreach($externalJS as $ext){
            $document->addScript($ext);
        }
    }
}
